<?php 

namespace Cli\Event;
use Think\Log;

abstract class TaskEvent
{

    static public function handle(array &$data)
    {
        if (!empty($data['action'])){
            $action = $data['action'];
            $eventName = ucfirst($action).'Task';
            $TaskEvent = A($eventName,'Event');
            if ($TaskEvent instanceof TaskEvent){
                $param = !empty($data['data']) ? $data['data'] : '';
                return $TaskEvent->run($param);
            }
        }
    }

    abstract public function run(&$param);
}